package commandPattern;

/**
 * @author： pang-yun
 * @date： 2021-12-31 13:14
 * 功能目的 ：用于  具体命令类
 */

public class LightOnCommand implements ICommand {

    public LightOnCommand(LightReceiver lightReceiver) {
        this.lightReceiver = lightReceiver;
    }

    private LightReceiver lightReceiver;

    @Override
    public void execute() {
        lightReceiver.on();
    }

    @Override
    public void undo() {
        lightReceiver.off();
    }
}
